<template>
  <div>
    <van-nav-bar title="标题" left-text="返回" class="top">
      <template #title>
        <span>地图找房</span>
      </template>
      <template #left>
        <span @click="$router.back()">返回</span>
      </template>
    </van-nav-bar>
    <baidu-map center="杭州"  :zoom="zoom" class="bm-view" @ready="handler"> </baidu-map>
  </div>
</template>

<script>
export default {
  name: "VueHkzfMap",

  data() {
    return {
      center: { lng: 0, lat: 0 },
      zoom: 3,
    };
  },
  methods: {
    handler({ BMap, map }) {
      console.log(BMap, map);
      this.center.lng = 116.404;
      this.center.lat = 39.915;
      this.zoom = 15;
    },
  },
};
</script>

<style lang="css" scoped>
.van-nav-bar {
  background-color: #21b97a;
}
.bm-view {
  width: 375px;
  height: 800px;
}
</style>
